---
title: Translate a keyword value
summary: Selects and translates a keyword's prior or new value, applying Y/N flag rules for three known keywords.
status: draft
owner: Documents
last_reviewed: 2026-09-17
operation_id: OP-006
trigger: Step 1 of OP-004 and step 4 of OP-005
---

# OP-006: Translate a keyword value

This operation selects either the prior or new value from a keyword-sync record and, for three known flag keywords, translates the value to `Y`/`N`. All other keywords pass through unchanged.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-006 |
| **Trigger** | Step 1 of [OP-004](decide-whether-a-record-is-sent-to-onbase.md) and step 4 of [OP-005](send-one-keyword-update-to-onbase.md) |
| **Lifecycle stage** | Execute |
| **Owning component** | `KeywordHelper.GetKeywordValue(ImageKeywordSync keyword, bool newValue)` |
| **Inputs** | One `ImageKeywordSync` record, a flag selecting `NewValue` or `PriorValue` |
| **Outputs** | The translated (or pass-through) keyword value string |
| **Failure exit code** | None — errors are logged and processing continues* |

## Steps

1. Select `NewValue` or `PriorValue` based on the flag
2. Upper-case `OnBaseKeyword` and look it up in the static yes/no translation table built in the static constructor ([BR-OBKS-009](../business-rules.md#br-obks-009-flag-keyword-translation))
3. If the keyword is a flag keyword, evaluate its predicate and return `"Y"`/`"N"`; otherwise return the raw value unchanged ([BR-OBKS-009](../business-rules.md#br-obks-009-flag-keyword-translation))
   - `CLAIM EXPOSURE FLAG` → `Y` when the value is not `"0"`
   - `CLAIM SECURED FLAG` → `Y` when the value is `R` or `T`
   - `POLICY SECURED FLAG` → `Y` when the value is non-blank

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
    A["Select NewValue<br>or PriorValue"] --> B["Upper-case OnBaseKeyword<br>look up in flag table"]
    B --> C{"Is a known<br>flag keyword?"}
    C -->|Yes| D["Evaluate flag predicate<br>return Y or N"]
    C -->|No| E["Return raw value<br>unchanged"]
```

## Logging

No logging occurs directly in this operation; the caller ([OP-004](decide-whether-a-record-is-sent-to-onbase.md), [OP-005](send-one-keyword-update-to-onbase.md)) logs the resolved value.

## Error handling
- A null `OnBaseKeyword` on the record throws `NullReferenceException` when this operation is called from OP-004*; this propagates to `OnBaseKeywordSyncRunner.Execute`'s catch block → exit code `5`.

## Related documentation
- [Run lifecycle](../run-lifecycle.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Operational runbook](../operational-runbook.md)

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

## Sources
- `OnBaseKeywordSync/Services/KeywordHelper.cs`
